package com.cloud.order.api.controller;

import com.cloud.order.api.fegin.OrderClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private OrderClient orderClient;

    @GetMapping("/create/{productId}")
    public String create(@PathVariable("productId") int productId) {
        orderClient.create(productId);
        return "创建订单成功";
    }

}
